package com.shi.yoyoshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shi.yoyoshop.bean.Goods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 20556
 * @description 针对表【goods】的数据库操作Mapper
 * @createDate 2024-01-04 15:06:01
 * @Entity com.shi.yoyoshop.bean.Goods
 */
public interface GoodsMapper extends BaseMapper<Goods> {

    /**
     * 根据商品类型查询商品列表
     * 商品分类  1：今日推荐 2：热销 3：新品
     *
     * @param typeId
     * @return
     */
    List<Goods> selectGoodsListByHotTypeId(@Param("typeId") Integer typeId);

    List<Goods> selectGoodsListByHotTypeIdWithPage(@Param("typeId") Integer typeId, @Param("start") Integer start, @Param("end") Integer end);

    Long selectGoodsCountByHotTypeId(@Param("typeId") Integer typeId);

    Goods selectGoodsAndTypeByGoodsId(@Param("goodId") Integer goodId);

    void updateGoodsById(@Param("goods") Goods goods);
}